package com.wt.dao;

import com.wt.pojo.brandAdminWithdrawOrder;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface brandAdminWithdrawOrderMapper {
    @Delete({
        "delete from brand_admin_withdraw_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into brand_admin_withdraw_order (id, distributor_id, ",
        "withdraw_id, send_time, ",
        "check_time, bank_address, ",
        "bank_card, money, ",
        "remark, status)",
        "values (#{id,jdbcType=INTEGER}, #{distributorId,jdbcType=INTEGER}, ",
        "#{withdrawId,jdbcType=BIGINT}, #{sendTime,jdbcType=INTEGER}, ",
        "#{checkTime,jdbcType=INTEGER}, #{bankAddress,jdbcType=VARCHAR}, ",
        "#{bankCard,jdbcType=VARCHAR}, #{money,jdbcType=DECIMAL}, ",
        "#{remark,jdbcType=VARCHAR}, #{status,jdbcType=SMALLINT})"
    })
    int insert(brandAdminWithdrawOrder record);

    int insertSelective(brandAdminWithdrawOrder record);

    @Select({
        "select",
        "id, distributor_id, withdraw_id, send_time, check_time, bank_address, bank_card, ",
        "money, remark, status",
        "from brand_admin_withdraw_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    brandAdminWithdrawOrder selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(brandAdminWithdrawOrder record);

    @Update({
        "update brand_admin_withdraw_order",
        "set distributor_id = #{distributorId,jdbcType=INTEGER},",
          "withdraw_id = #{withdrawId,jdbcType=BIGINT},",
          "send_time = #{sendTime,jdbcType=INTEGER},",
          "check_time = #{checkTime,jdbcType=INTEGER},",
          "bank_address = #{bankAddress,jdbcType=VARCHAR},",
          "bank_card = #{bankCard,jdbcType=VARCHAR},",
          "money = #{money,jdbcType=DECIMAL},",
          "remark = #{remark,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=SMALLINT}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(brandAdminWithdrawOrder record);
}